// import React from 'react'
import ReactDOM from 'react-dom/client';
import App from './App.tsx';
import './style.less';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import { ConfigProvider } from 'antd';
import { mockRuqest } from '@/mock';
import store from '@/store';
// import routes from './router/index.tsx'
import { registerMicroApps, start } from 'qiankun';

console.log('--------main-app-react18--------');
if (import.meta.env.MODE === 'mock') {
	mockRuqest();
}

registerMicroApps([
  {
    name: 'subReactApp', // app name registered
    entry: '//localhost:3002',
    container: '#sub-app',
    activeRule: '/react-app',
  },
  {
    name: 'subVueApp',
    entry: '//localhost:3001',
    container: '#sub-app',
    activeRule: '/vue-app',
  },
]);
start();

ReactDOM.createRoot(document.getElementById('root')!).render(
	// <React.StrictMode>
	<Provider store={store}>
		<BrowserRouter>
			<ConfigProvider>
				<App />
				{/* <RouterProvider router={routes} /> */}
			</ConfigProvider>
		</BrowserRouter>
	</Provider>
	// </React.StrictMode>
);
